<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>css实现心形效果</title>
		<style type="text/css">
			#myheart{
				position: relative;
				width: 150px;
				height: 220px;
			}
			#myheart:before,#myheart:after{
				position: absolute;
				left: 100px;
				background: red;
				width: 100px;
				height: 160px;
				content: '';
				border-radius: 50px 50px 0 0;
				transform: rotate(-45deg);
				transform-origin: 0 100%;
			}
			#myheart:after{
				left: 0;
				transform: rotate(45deg);
				transform-origin: 100% 100%;
			}
			.myheart{
				position: absolute;
				top: 40%;
				left: 40%;
				animation: heart 1.5s linear infinite;
			}
			@keyframes heart{
				0%{
					transform: scale(1);
				}
				50%{
					transform: scale(0.8);
				}
				100%{
					transform: scale(1);
				}
			}
		</style>
	</head>
	<body>
		<div class="myheart">
			<div id="myheart"></div>
		</div>
	</body>
</html>
